<?php

namespace app\admin\validate\setting;

use tmcore\base\BaseValidate;

/**
 * Redis 数据库验证器
 */
class DbRedisValidate  extends BaseValidate
{

    protected $rule = [
        'key' => 'require',
        'value' => 'require',
        'time' => 'require',
    ];

    protected $message = [
        'key' => 'key不能为空',
        'value' => '值不能为空',
        'time' => '有效期不能为空',
    ];

    /**
     * 获取缓存场景
     * @return DbRedisValidate
     */
    public function sceneDetail()
    {
        return $this->only(['key']);
    }

    /**
     * 编辑缓存场景
     * @return DbRedisValidate
     */
    public function sceneEdit()
    {
        return $this->only(['key', 'value', 'time']);
    }

    /**
     * 删除缓存场景
     * @return DbRedisValidate
     */
    public function sceneDelete()
    {
        return $this->only(['key']);
    }

}